package collection;


import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NnwforDemo {
    public static void main(String[] args) {
        String[] arra={"one","two","three","four","five"};
        for (int i=0;i<arra.length;i++ ){
            String e=arra[i];
            System.out.println(e);

        }
        for (String e:arra){
            System.out.println(e);
        }
        Collection<String> c =new ArrayList<>();
        c.add("1");
        c.add("2");
        c.add("3");
        c.add("4");
        c.add("5");
        Iterator<String> it =c.iterator();
        while (it.hasNext()){
            String e =it.next();
            System.out.println(e);
        }
        for (String e:c){

            System.out.println(e);
        }
    }
}
